﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;

/*
 * 
 * 
 * FINISHED!
 * 
 * 
 * 
 */

namespace MySQLLib
{
    public class Saved_skills
    {
        public static string[][] getSavedSkillsFromOwner(MySqlConnection conn, int owner)
        {
            string[][] result;
            string[] columns = new string[1];
            columns[0] = "*";

            result = Query.SelectQuery(conn, "saved_skills", columns, "owner=" + owner.ToString(), "id");

            return result;
        }

        public static string[] getSkillDataAtRow(MySqlConnection conn, int id)
        {
            string[] result;

            result = Query.getRowData(conn, "saved_skills", id);

            return result;
        }

        public static void addSavedSkill(MySqlConnection conn, int owner, int skillid, int level = 1)
        {
            string[] columns = new string[3];
            string[] values = new string[3];

            columns[0] = "owner";
            columns[1] = "skillid";
            columns[2] = "level";

            values[0] = owner.ToString();
            values[1] = skillid.ToString();
            values[2] = level.ToString();

            Query.InsertQuery(conn, "saved_skills", columns, values);
        }

    }
}
